local instances = {}

instances.GenericException = function(text)
 gui.printAppWarning(fs.getName(shell.getRunningProgram()), text)
 log.writeSecurity(text) 
end

instances.RestrictedOpsException = function(a)
 b = a or " "
 gui.printAppWarning("kernel", "attempt to perform restricted operations")
 log.writeSecurity("Attempt to perform restricted operations!")
 log.writeSecurity("Attempt blocked.")
end

instances.SecurityException = function(path)
 gui.printAppWarning("kernel", "attempt to perform restricted operations")
 log.writeSecurity(_activeUser.." attempted to open restricted file at "..path)
end

function throw(exception, arg)
 if instances[exception] then
  instances[exception](arg)
 else
  instances.GenericException("no such exception")
 end
end